<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Team Bonus Summary</title>
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.21.custom.min.js"></script>
<script type="text/javascript" src="/js/jquery.leanModal.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script language="javascript"> 
function transfer(date_begin,date_end){

	window.location.href = 'http://<?php echo SERVER_IP_COMM?>/repairparts/repair-wizard-distribution/date_begin/'+ date_begin + '/date_end/' + date_end + '/next/yes';
}

</script>

</head>
<body style="font-family:Arial, Helvetica, sans-serif; line-height:20px;">
<form method = "post" action = "">
<h2>Repair Bonus Summary for cycle ( <?php echo $this->cycle;?> )</h2>
<h3><?php echo $this->dateBegin;?> ~ <?php echo $this->dateEnd;?></h3>
<table width="600" border="1" cellspacing="1" cellpadding="5">
	<tr>
		<th>Shop Group</th>
		<th>Total Stock Lost</th>
		<th>Current Bonus</th>
		<th>Before Bonus</th>
		<th>Ex Bonus</th>
		<th>Net Bonus</th>
		<th>Carry Stock Lost</th>
	</tr>
<?php foreach($this->bonusList as $k => $v){?>
	<tr>
		<td><input type = "text" name = "shop_code[<?php echo $v['id_shop']?>]" value = "<?php echo $v['shop_code']?>"></input></td>
		<td><?php echo $v['adj_stocklost'];?></td>
		<td><?php echo $v['final_bonus']?></td>
		<td><?php echo $v['carry_bonus']?></td>
		<td><?php echo $v['ex_bonus']?></td>
		<td <?php if($v['net_bonus'] > 0){?>style=" background-color:#2FF20D;"<?php }elseif($v['net_bonus'] < 0){?>style=" background-color:red;"<?php }?>
		><input type = "text" name = "net_bonus[<?php echo $v['id_shop']?>]" id = "net_bonus[<?php echo $v['id_shop']?>]" value = "<?php echo $v['net_bonus']?>"></input></td>
		<td <?php if($v['carry_stock_lost'] > 0){?>style=" background-color:#2FF20D;"<?php }elseif($v['carry_stock_lost'] < 0){?>style=" background-color:red;"<?php }?>
		><input type = "text" name = "carry_stocklost[<?php echo $v['id_shop']?>]" id = "carry_stocklost[<?php echo $v['id_shop']?>]" value = "<?php echo $v['carry_stock_lost']?>"></input></td>
	</tr>
<?php }?>

</table>
<br/>
<input type = "submit" name ="submit" id = "submit" value = "Confirm" ></input>
</form>
<div id = "payrollWizard" <?php if(!$this->nextCheck){?>style = "visibility:hidden;<?php }?>">
<input type = "submit" name = "next" id = "next" value = "Next" style = "margin-left:650px;" onclick= "transfer('<?php echo $this->dateBegin;?>','<?php echo $this->dateEnd;?>')"></input>
</div>

</body>
</html>
